import { defHttp } from '/@/utils/http/axios';
enum Api {
  getMainFields = '/hiprint/get-main-fields',
  getOtherFields = '/hiprint/get-other-fields',
  saveOrUpdateTpl = '/hiprint//tpl/save-or-update',
  getTpl = '/hiprint//tpl/get',
}

/**
 * 获取单据打印字段
 * @param params
 */
export const getMainFields = (params) => {
  return defHttp.get({ url: Api.getMainFields, params });
};

/**
 * 获取其他打印字段
 * @param params
 */
export const getOtherFields = (params) => {
  return defHttp.get({ url: Api.getOtherFields, params });
};

/**
 * 保存或者更新打印模板
 * @param params
 */
export const saveOrUpdate = (params) => {
  return defHttp.post({ url: Api.saveOrUpdateTpl, params });
};

/**
 * 获取打印模板
 * @param params
 */
export const getTpl = (params) => {
  return defHttp.get({ url: Api.getTpl, params });
};
